// class CommonBankCardItemVo {
//   int? id;
//   int? userId;
//   int? type;
//   String? accountName;
//   String? cardNumber;
//   int? isDefault;
//   int? bankId;
//   String? bank;
//   String? createdAt;
//   String? updatedAt;
//   String? deletedAt;
//   String? identityNumber;

//   CommonBankCardItemVo(
//       {this.id,
//       this.userId,
//       this.type,
//       this.accountName,
//       this.cardNumber,
//       this.isDefault,
//       this.bankId,
//       this.bank,
//       this.createdAt,
//       this.updatedAt,
//       this.deletedAt,
//       this.identityNumber});

//   CommonBankCardItemVo.fromJson(Map<String, dynamic> json) {
//     id = json['id'];
//     userId = json['user_id'];
//     type = int.parse(json['type'].toString());
//     accountName = json['account_name'];
//     cardNumber = json['card_number'];
//     isDefault = json['is_default'];
//     bankId = json['bank_id'];
//     bank = json['bank'];
//     createdAt = json['created_at'];
//     updatedAt = json['updated_at'];
//     deletedAt = json['deleted_at'];
//     identityNumber = json['identity_number'];
//   }

//   Map<String, dynamic> toJson() {
//     final Map<String, dynamic> data = new Map<String, dynamic>();
//     data['id'] = this.id;
//     data['user_id'] = this.userId;
//     data['type'] = this.type;
//     data['account_name'] = this.accountName;
//     data['card_number'] = this.cardNumber;
//     data['is_default'] = this.isDefault;
//     data['bank_id'] = this.bankId;
//     data['bank'] = this.bank;
//     data['created_at'] = this.createdAt;
//     data['updated_at'] = this.updatedAt;
//     data['deleted_at'] = this.deletedAt;
//     data['identity_number'] = this.identityNumber;
//     return data;
//   }
// }


class CommonBankCardItemVo {
  int? id;
  int? userId;
  String? accountName;
  String? identityNumber;
  String? cardNumber;
  int? bankId;
  int? isDefault;
  String? createdAt;
  int? type;
  String? mobile;
  Bank? bank;

  CommonBankCardItemVo(
      {this.id,
      this.userId,
      this.accountName,
      this.identityNumber,
      this.cardNumber,
      this.bankId,
      this.isDefault,
      this.createdAt,
      this.type,
      this.mobile,
      this.bank});

  CommonBankCardItemVo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    userId = json['user_id'];
    accountName = json['account_name'];
    identityNumber = json['identity_number'];
    cardNumber = json['card_number'];
    bankId = json['bank_id'];
    isDefault = json['is_default'];
    createdAt = json['created_at'];
    type = json['type'];
    mobile = json['mobile'];
    bank = json['bank'] != null ? new Bank.fromJson(json['bank']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['user_id'] = this.userId;
    data['account_name'] = this.accountName;
    data['identity_number'] = this.identityNumber;
    data['card_number'] = this.cardNumber;
    data['bank_id'] = this.bankId;
    data['is_default'] = this.isDefault;
    data['created_at'] = this.createdAt;
    data['type'] = this.type;
    data['mobile'] = this.mobile;
    if (this.bank != null) {
      data['bank'] = this.bank!.toJson();
    }
    return data;
  }
}

class Bank {
  int? id;
  int? channel;
  String? code;
  String? title;

  Bank({this.id, this.channel, this.code, this.title});

  Bank.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    channel = json['channel'];
    code = json['code'];
    title = json['title'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['channel'] = this.channel;
    data['code'] = this.code;
    data['title'] = this.title;
    return data;
  }
}
